﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using Microsoft.EntityFrameworkCore;

namespace WorkOrder.Models;

/// <summary>
/// 工单附件表
/// </summary>
[Table("工单附件表")]
[Index("用户id", Name = "fk_附件_用户")]
[Index("工单id", Name = "idx_工单")]
public partial class 工单附件表
{
    /// <summary>
    /// 附件ID
    /// </summary>
    [Key]
    [Column("附件ID")]
    public long 附件id { get; set; }

    /// <summary>
    /// 工单ID
    /// </summary>
    [Column("工单ID")]
    public string 工单id { get; set; }

    /// <summary>
    /// 上传人
    /// </summary>
    [Column("用户ID")]
    public string 用户id { get; set; }

    /// <summary>
    /// 文件名
    /// </summary>
    [StringLength(255)]
    public string 文件名 { get; set; } = null!;

    /// <summary>
    /// 文件类型
    /// </summary>
    [StringLength(50)]
    public string 文件类型 { get; set; } = null!;

    /// <summary>
    /// 文件大小(字节)
    /// </summary>
    public long 文件大小 { get; set; }


    public bool 是否提交 { get; set; }

    /// <summary>
    /// 存储路径
    /// </summary>
    [StringLength(512)]
    public string 存储路径 { get; set; } = null!;

    /// <summary>
    /// 上传时间
    /// </summary>
    [Column(TypeName = "datetime")]
    public DateTime 上传时间 { get; set; }

    [ForeignKey("工单id")]
    [InverseProperty("工单附件表s")]
    public virtual 工单主表 工单 { get; set; } = null!;
}
